<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>

<html>
	<head>
		<title>山西海宁皮革城</title>
		<%@ include file="/commons/meta.jsp"%>
		<script type="text/javascript">
		$(document).ready(function(){
			
			/* setup navigation, content boxes, etc... */
			Administry.setup();
			
			/* datatable */
			$('#example').dataTable();
			
			/* expandable rows */
			Administry.expandableRows();
		});
		
		</script>
	</head>

	<body>
		<%@ include file="/commons/top.jsp"%>
		<!-- Page title -->
		<div id="pagetitle">
			<div class="wrapper">
				<h1>User Information</h1>
				<s:if test="#session.login_user.permission == 1">
	 				<a href="${ctx }/pages/userInfo/add.jsp" class="btn"><span class="icon icon-add">&nbsp;</span>添加员工</a>
	 			</s:if>
			</div>
		</div>
		<!-- End of Page title -->
		
		<!-- Page content -->
		<div id="page">
			<!-- Wrapper -->
			<div class="wrapper">
					<!-- Left column/section -->
					<section class="column full first">					
						
						<table class="display stylized" id="example">
							<thead>
								<tr>
									<th>账号</th>
									<th>用户名</th>
									<th>性别</th>
									<th>部门</th>
									<th>手机号码</th>
									<th>Email</th>
									<th>是否有登陆权限</th>
	                                <th>权限</th>
	                                <th>创建者</th>
	                                <th>创建时间</th>
	                                <th>最后一次登陆时间</th>
	                                <s:if test="#session.login_user.permission == 1">
	                                	<th>操作</th>
	                                </s:if>
								</tr>
							</thead>
							<tbody>
								<s:iterator value="#request.userList" var="u" status="ul">
									<tr 
										<s:if test="#ul.index%4 == 0"> class="gradeX" </s:if>
										<s:if test="#ul.index%4 == 1"> class="gradeA" </s:if>
										<s:if test="#ul.index%4 == 2"> class="gradeC" </s:if>
										<s:if test="#ul.index%4 == 3"> class="gradeU" </s:if>
									>
									
										<td><s:property value="#u.userid"/></td>
										<td><s:property value="#u.username"/></td>
										<td>
											<s:if test="#u.userDetail.sexual == 1">
														男
											</s:if>	
											<s:if test="#u.userDetail.sexual == 0">
														女
											</s:if>
										</td>
										<td><s:property value="#u.userDetail.title"/></td>
										<td><s:property value="#u.userDetail.mobile"/></td>
		                                <td><s:property value="#u.userDetail.email"/></td>
		                                <td>
		                                	<s:if test="#u.suspend == 1">
														有
											</s:if>	
											<s:if test="#u.suspend == 0">
														无
											</s:if>	
		                                </td>
		                                <td>
		                                	<s:if test="#u.permission == 1">
													管理员
											</s:if>	
											<s:if test="#u.permission == 2">
													财务
											</s:if>	
											<s:if test="#u.permission == 3">
													前台
											</s:if>		
		                                </td>
		                                <td><s:property value="#u.createUser"/></td>
		                                <td><s:date name="#u.createTime" format="yyyy-MM-dd HH:mm:ss" /></td>
		                                <td><s:date name="#u.lastLoginTime" format="yyyy-MM-dd HH:mm:ss" /></td>
		                                
		                                <s:if test="#session.login_user.permission == 1">
			                                <td>
				                                <a href="userOpt!goModifyPage.do?userid=<s:property value='#u.userid'/>">修改</a>
				                                <span style="padding:10px;">|</span>
				                                <a href="#confirm"  
					                                onclick="setUrl('userOpt!removeUser.do?userid=<s:property value="#u.userid"/>','删除<s:property value="#u.userid"/>用户');" 
					                                class="nyroModal">删除</a>
				                            </td>
			                            </s:if>	
			                            
									</tr>
								</s:iterator>
							</tbody>
							<tfoot>
								<tr>
									<th>账号</th>
									<th>用户名</th>
									<th>性别</th>
									<th>部门</th>
									<th>手机号码</th>
									<th>Email</th>
									<th>是否有登陆权限</th>
	                                <th>权限</th>
	                                <th>创建者</th>
	                                <th>创建时间</th>
	                                <th>最后一次登陆时间</th>
	                                <s:if test="#session.login_user.permission == 1">
	                                	<th>操作</th>
	                                </s:if>
								</tr>
							</tfoot>
						</table>
						
						<div class="clear">&nbsp;</div>
						
					</section>
					<!-- End of Left column/section -->
					
					
			</div>
			<!-- End of Wrapper -->
		</div>							
		<!-- End of Page content -->
		
		<!-- Page footer -->
		<%@ include file="/commons/footer.jsp"%>
		<!-- End of Page footer -->
		
		<!-- Scroll to top link -->
		<a href="#" id="totop">^ scroll to top</a>
	
		<!-- User interface javascript load -->
		<script type="text/javascript" SRC="js/administry.js"></script>
	</body>
</html>
